<template>
  <div>
    <h3>App</h3>
    <p>username:{{username}}</p>
    <hr>
    <Son str="我是父组件的字符串str"
         :username123="username"
         :car="car" 
         :hitSon="hitSon"
         :changeUsername="changeUsername"
         />
  </div>
</template>

<script>
import Son from './components/Son.vue'
export default {
  components: { Son },
  name: 'App',
  data() {
    return {
      username: 'atguigu',
      car: { name: '奥拓', money: 20000, age: 15 },
    }
  },
  methods: {
    hitSon() {
      console.log('打儿子', this)
    },
    // 改变username
    changeUsername(value){
        this.username = value
    }
  },
}
</script>

<style>
</style>